package com.project.ssm.dao;

import com.project.ssm.domain.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;


import java.util.List;


public interface IProductDao {
    //查询所有商品信息
    @Select("select * from product")
    public List<Product> findAll() throws Exception;

    //添加商品信息
    @Insert("insert into product values(NULL,#{productNum},#{productName},#{cityName},#{departureTime},#{productPrice},#{productDesc},#{productStatus})")
    void save(Product product);

    //根据id查询商品
    @Select("select * from product where id = #{id}")
    public Product findById(Integer id) throws Exception;
}
